<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>3D骰子</title>
    <style>
        body{
            background-color: bisque;
            width: 100vw;
            height: 100vh;
            display: flex;
            justify-content: center;
            align-items: center;
        }
        main{
            width: 100px;
            height: 100px;
            display: flex;
            transform-style: preserve-3d;
            animation: move 5s linear infinite;
        }
        @keyframes move {
            from{
                transform: rotateY(0deg) rotateZ(0deg);
            }
            to{
                transform: rotateY(360deg) rotateZ(360deg);
            }
        }
        div{
            position: absolute;
            width: 100px;
            height: 100px;
            background-color: #fff;
            box-shadow: 0 0 10px #bbb;
            display: flex;
            justify-content: center;
            flex-wrap: wrap;
            align-items: center;
        }
        div:first-child{
            transform: translateZ(50px);
        }
        div:nth-child(2){
            transform: rotateY(90deg) translateZ(50px);
            flex-direction: column;
            justify-content: space-around;
        }
        div:nth-child(3){
            transform: rotateY(270deg) translateZ(50px);
            padding: 10px;
            box-sizing: border-box;
        }
        div:nth-child(4){
            transform: rotateY(180deg) translateZ(50px);
            padding: 10px;
            box-sizing: border-box;
        }
        div:nth-child(5){
            transform: rotateX(90deg) translateZ(50px);
        }
        div:nth-child(6){
            transform: rotateX(270deg) translateZ(50px);
        }
        div:nth-child(3) span:nth-child(1){
            align-self: flex-start;
        }
        div:nth-child(3) span:nth-child(3){
            align-self: flex-end;
        }
        span{
            display: inline-block;
            width: 25px;
            height: 25px;
            background-color: red;
            border-radius: 50%;
            box-shadow: inset 0 3px #b60505,inset 0 -2px #fa5d5d;
        }
        nav{
            width: 100%;
            height: 25px;
            display: flex;
            justify-content: space-around;
        }
    </style>
</head>
<body>
    <main>
        <div id="aa">
         <span></span>
        </div>
        <div id="bb">
            <span></span>
            <span></span>
        </div>
        <div id="cc">
            <span></span>
            <span></span>
            <span></span>
        </div>
        <div id="dd">
            <nav>
                <span></span>
                <span></span>
            </nav>
            <nav>
                <span></span>
                <span></span>
            </nav>
        </div>
        <div id="ee">
            <nav>
                <span></span>
                <span></span>
            </nav>
            <nav>
                <span></span>
            </nav>
            <nav>
                <span></span>
                <span></span>
            </nav>
        </div>
        <div id="hh">
            <nav>
                <span></span>
                <span></span>
            </nav>
            <nav>
                <span></span>
                <span></span>
            </nav>
            <nav>
                <span></span>
                <span></span>
            </nav>
        </div>
    </main>
</body>
</html>